package com.example.myapplication001.slice.home_page;

import com.example.myapplication001.ResourceTable;
import com.example.myapplication001.slice.exercise.ExerciseOutRunAbilitySlice;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Button;
import ohos.agp.components.Component;
import ohos.agp.components.Image;

//主页健康
public class MainAbilitySlice extends AbilitySlice {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);



        Button button_wd =(Button) findComponentById(ResourceTable.Id_button_wd);
        button_wd.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入MyAbilitySlice
                present(new MyAbilitySlice(),new Intent());
            }
        });

        Image image_wd =(Image) findComponentById(ResourceTable.Id_image_wd);
        image_wd.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入MyAbilitySlice
                present(new MyAbilitySlice(),new Intent());
            }
        });

        Button button_yq =(Button) findComponentById(ResourceTable.Id_button_qy);
        button_yq.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入FriendsAbilitySlice
                present(new FriendsAbilitySlice(),new Intent());
            }
        });

        Image image_qy =(Image) findComponentById(ResourceTable.Id_image_qy);
        image_qy.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入FriendsAbilitySlice
                present(new FriendsAbilitySlice(),new Intent());
            }
        });

        Button button02 = (Button) findComponentById(ResourceTable.Id_button02);
        button02.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                //进入ExerciseAbilitySlice
                present(new ExerciseOutRunAbilitySlice(),new Intent());
            }
        });



    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
